package com.lxy.cloud.mqtt.client.service;

import com.lxy.cloud.mqtt.client.model.dto.BaseMqttDTO;

/**
 * @Author: lxy
 * @Date: 2020/9/7 14:59
 * @Desc: 业务处理抽象类
 */
public abstract class AbstractMessageProcessService<T extends BaseMqttDTO> implements MessageProcessService {


    protected abstract T convertMessage(BaseMqttDTO request);

    protected abstract void process(T acpMessage);

    @Override
    public void onEvent(BaseMqttDTO request) {
        process(convertMessage(request));
    }
}
